(function(){
	var defAdmCmd0=function(name){
		var c=Java.type(name);
		defAdmCmd(new c());
	};
	defAdmCmd0("org.hxzon.rpggame.admcmd.TestAdmCmd");
	defAdmCmd0("org.hxzon.rpggame.admcmd.EchoAdmCmd");
	//
	defAdmCmd(new AbstractAdmCmdImpl("echomore"){
		Inputs:"EchoMore.inputs",
		execute:function(cmdLine,ctx){
			var data=getChannelData(ctx.channel());
			data.put(AdmChannelDataConsts.CurCmd,this);
			data.put(this.Inputs,new ArrayList());
		},
		executeContinue:function(cmdLine,ctx){
			var data=getChannelData(ctx.channel());
			var inputs = data.get(this.Inputs);
	        var token = cmdLine.nextToken();
	        if ("-q".equals(token)) {
	            for each(var input in inputs) {
	                ctx.writeAndFlush(input);
	            }
	            data.remove(this.Inputs);
	            data.remove(AdmChannelDataConsts.CurCmd);
	            return;
	        }
	        inputs.add(cmdLine.getStr());
		},
		usage:function(){
			return "-q echo and quit";
		}
	});
})();
